#include "mainwindow.h"
#include"mythread.h"
#include"worker.h"

#include <QApplication>
#include <QDebug>
#include <windows.h>
#include<QMessageBox>





BOOL CALLBACK window_callback(HWND window, LPARAM lParam) {

    char title[255];
    GetWindowTextA(window, title, sizeof(title));
    qDebug() << title << endl;
    return TRUE;
}




int main(int argc, char *argv[])
{
    EnumWindows(window_callback, 0);

    auto th1 = new QThread();

    auto w1 = new worker();

    w1->moveToThread(th1);
    QObject::connect(th1,SIGNAL(started()),w1,SLOT(run()));
    th1->start();





    QApplication a(argc, argv);
    MainWindow w;


    auto th = new MyThread();
    QObject::connect(th,&QThread::started,[&](){
        qDebug()<<"xxxxxxxxxxxxxxxx";
    });
    QMessageBox::information(&w,"明天","明天");
    th->start();


    w.show();
    return a.exec();
}
